﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Collections.Generic;

public partial class Users_MyRemittanceList : System.Web.UI.Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSThemes();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = BasePage.WebTitle;
        if (HttpContext.Current.User.Identity.IsAuthenticated)
        {
            if (!IsPostBack)
            {
                AspNetPager1.PageSize = 50;
                BindRepeater();
            }
        }
        else
        {
            Response.Redirect("Login.aspx");
        }
    }
    private void BindRepeater()
    {
        try
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(" where V_CUSTOMER.BYZD5='" + BasePage.GetValue(0) + "' ");

           
            int recordCount;
            DataSet dst = new BLL.REMITTANCE().GetRemittance_List(GetStartIndex(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize), AspNetPager1.PageSize, strSql.ToString(), out recordCount);
            rptREMITTANCE.DataSource = dst;
            rptREMITTANCE.DataBind();
            AspNetPager1.RecordCount = recordCount;
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('" + ex.Message + "')</script>");
        }
    }
    private int GetStartIndex(int pageIndex, int pageSize)
    {
        return 1 + (pageIndex - 1) * pageSize;
    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindRepeater();
    }
}
